package com.youchuang.action.admin;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Actions;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

import com.opensymphony.xwork2.ActionSupport;
import com.youchuang.action.BaseAction;
import com.youchuang.common.Constant;
import com.youchuang.service.AdminService;

/**
 * 用户订单删除
 * 
 * @author Administrator
 *
 */
@Namespace(value = "/indent")
@ParentPackage("shopping-default")
public class IndentDelAction extends BaseAction {
	private Logger logger = Logger.getLogger(IndentDelAction.class.getSimpleName());
	private String id;
	
	@Resource
	private AdminService adminService;

	@Actions({
			@Action(value = "indentDel", results = {
					@Result(name = ActionSupport.SUCCESS, type = "redirectAction", params = { "namespace", "/user",
							"actionName", "selectIndent" }) }),
			@Action(value = "indentDelete", results = {
					@Result(name = Constant.SUCCESS, type = "json", params = { "root", "resultObj" }) }) })
	public String execute() throws Exception {
		logger.info("excetion is execute");
		adminService.deleteIndentById(id);

		return ActionSupport.SUCCESS;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

}
